package com.example.printer2;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;

import com.example.printer2.adapter.PrinterAdapter;
import com.example.printer2.common.MyBuildConfig;
import com.jaeger.library.StatusBarUtil;

public class PrinterActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_printer);
        listView=findViewById(R.id.listview);
        StatusBarUtil.setColor(this,getResources().getColor(R.color.yellow),0);
        init();
    }

    private  ListView listView;
    void init()
    {
        PrinterAdapter printerAdapter=new PrinterAdapter(MyBuildConfig.printerList,this);
        listView.setAdapter(printerAdapter);
    }

    public void toMine(View view)
    {
        Intent intent=new Intent(this,MainActivity.class);
        startActivity(intent);
        this.overridePendingTransition(0, 0);
    }

    public void toRecord(View view)
    {
        Intent intent=new Intent(this,RecordActivity.class);
        startActivity(intent);
        this.overridePendingTransition(0, 0);
    }

}